<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>登录页面</title>
  <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f2f2f2;
      padding: 20px;
    }

    .container {
      max-width: 400px;
      margin: 0 auto;
      background-color: #fff;
      padding: 20px;
      border-radius: 5px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }

    h2 {
      text-align: center;
    }

    .form-group {
      margin-bottom: 15px;
    }

    .form-group label {
      display: block;
      margin-bottom: 5px;
    }

    .form-group input {
      width: 100%;
      padding: 8px;
      border: 1px solid #ccc;
      border-radius: 3px;
    }

    .form-group input[type="submit"] {
      background-color: #4CAF50;
      color: #fff;
      cursor: pointer;
    }
  </style>
</head>
<body>
<div class="container">
  <h2>登录</h2>
  <form action="/login" method="post">
    <div class="form-group">
      <label for="username">用户名</label>
      <input type="text" id="username" name="username" required>
    </div>
    <div class="form-group">
      <label for="password">密码</label>
      <input type="password" id="password" name="password" required>
    </div>
    <div class="form-group">
<!--      <input type="submit" value="登录">-->
      <input type="button" value="登录" id="loginBtn">
    </div>
  </form>
</div>

<script>
  $(document).ready(function() {
    $('#loginBtn').click(function() {
      var username = $('#username').val();
      var password = $('#password').val();
      $.ajax({
        url: '/login',
        type: 'POST',
        data: { username: username, password: password },
        success: function(response) {
          // 处理登录成功的逻辑，例如跳转到其他页面或显示消息等。
          console.log('登录成功');
        },
        error: function(error) {
          // 处理登录失败的逻辑，例如显示错误消息等。
          console.log('登录失败');
        }
      });
    });
  });
</script>
</body>
</html>